package com.online.service;

import com.online.dao.StudentClassMapper;
import com.online.entity.StudentClass;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentClassServiceImpl implements StudentClassService {

    @Autowired
    StudentClassMapper studentClassMapper;

    @Override
    public List<StudentClass> showClassByTeacherNubmer(String teacherNumber) {
        return studentClassMapper.selectClassByTeacherNumber(teacherNumber);
    }

    @Override
    public StudentClass showAClassDetail(String teacherNumber, String examName) {
        return studentClassMapper.selectAClass(teacherNumber,examName);
    }

    @Override
    public int deleteAStudentClass(Integer classId) {
        return studentClassMapper.deleteAClass(classId);
    }

    @Override
    public int insertARecord(StudentClass studentClass) {
        return studentClassMapper.insertARecord(studentClass);
    }

    @Override
    public StudentClass showClassDetailById(Integer classId) {
        return studentClassMapper.selectByStudentClassId(classId);
    }

    @Override
    public List<Integer> showIdByClassName(String className) {
        return studentClassMapper.selectIdByClassName(className);
    }

    @Override
    public List<StudentClass> showAllClass() {
        return studentClassMapper.selectAllClass();
    }

    @Override
    public StudentClass showAClass(String teacherNumber, String className) {
        return studentClassMapper.selectByTeacherNumberAndClassName(teacherNumber,className);
    }
}
